﻿using Unity.Interception.PolicyInjection.Pipeline;
using Unity.Interception.PolicyInjection.Policies;

namespace NoteHelper.Business.IbatisImpl
{
    /// <summary>
    /// 事务处理标记
    /// a.注意需要继承HandlerAttribute;
    /// b.重写了基类的CreateHandler方法 返回事务拦截器TransactionInterceptor
    /// </summary>
    public class TransactionAttribute : HandlerAttribute
    {
        public TransactionAttribute()
        {
            this.Order = 1;
        }

        public override ICallHandler CreateHandler(Unity.IUnityContainer container)
        {
            return new TransactionInterceptor(Order);
        }
    }
}
